<template>
  <div>
    <a-result
        status="success"
        title="登陆成功"
        sub-title="正在跳转"
    >
    </a-result>
  </div>
</template>

<script>
export default {
  name: "OK",
  mounted() {

    const url = window.location.href.toString()
    const  codes= url.split("=")
    this.$axios({
      method:'get',
      url:'/login/weibo?code='+codes[1],
    }).then(res=>{
      this.$router.replace("/home")
      console.log(res)
      localStorage.setItem("Access-Token", res.data.loginToken);
      if (res.data.msg === "success") {
        this.$notification.success({
          message: '成功',
          description:
              '你好啊',
        });
      }
    })
  }
}
</script>

<style scoped>

</style>